<template>
  <view>
	 <tui-navigation-bar :isOpacity="false" @init="initNavigation" @change="opacityChange" :scrollTop="scrollTop" backgroundColor="var(--bg-main)" color="var(--text-main)">		 
	 	<view class="tab-box">
	 		<view class="zhong">
	 			<view class="tab-box">
	 				<view class="title-label" @click="tabsChange" :data-i="i" v-for="(item,i) in tabList" :key="i">
	 					<text
	 						:style="{fontWeight:current==i?'bold':'',fontSize:current==i?'40rpx':'32rpx'}">
	 						{{item.name}}
	 					</text>
	 				</view> 
	 			</view>
	 		</view>
	 	</view>
	 </tui-navigation-bar>

  </view>
</template>

<script>
	import tuiNavigationBar from "@/components/thorui/tui-navigation-bar/tui-navigation-bar.vue";
	import sheep from '@/sheep';
	export default {
		components: {
			tuiNavigationBar,
		},
		props: {
			title: {
				type: String,
				default: '',
			},
		},
		data() {
			return {
				top: 0, //标题图标距离顶部距离
				opacity: 1,
				height: 0,
				scrollTop: 0.5,
				
				tabList: [
					{
						name: '关注',
						value: '0',
					},
					{
						name: '推荐',
						value: '1',
					}
				],
				current: 1, 
			}
		},
		computed: {
			clerk: {
			    get() {
			      return sheep.$store('sys').currentClerk;
			    },
			},
		},
		methods: {
			initNavigation(e) {
				this.height = e.height;
				this.opacity = e.opacity;
				this.top = e.top;
				this.$emit('initNav', e);
			},
			opacityChange(e) {
				this.opacity = e.opacity;
			},
			tabsChange(e) {
				this.current = e.currentTarget.dataset.i; 
				this.$emit('tabsChange', this.tabList[this.current].value);
			},
			changeClerk() {
				this.$emit('changeClerk');
			}
		}
	}
</script>

<style lang="scss" scoped>
	.zhong {
		//width: 230rpx;
	}
	
	.tab-box {
		display: flex;
		justify-content: left;
		align-items: left;
	}
	
	.avatar-box {
		display: flex;
		align-items: left;
		position: absolute;
		left: 40rpx;
		
		.icon {
			position: absolute;
			right: 0;
			bottom: 0;
		}
	}
	
	.tab-box .title-label {
		height: 44px;
		padding: 0 20rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		position: relative;
		//font-size: 34rpx;
	}
	
	.tab-box .title-label text {
		transition: all 0.3s;
	}
	

</style>